<?php
require_once "config1.php";
//require_once "process_date.php";

$active_offers = list_active_offers();
function list_active_offers() {
        $db_obj = new DB();
        $offer_sql = "SELECT *
                        FROM offer
                       WHERE offer_available='Y'";
        $db_obj->query($offer_sql);
        if($db_obj->rowCount() > 0) {
            $offer_details = $db_obj->getResults($offer_sql);
            $extra_obj = new Extra();
            return $extra_obj->objectToArray($offer_details);
        } else {
            return false;
        }
    }
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Hotels With Offers</title>
	<script language="Javascript" type="text/javascript" src="js/jquery-1.4.1.js"></script>
	<script language="Javascript" type="text/javascript" src="js/jquery.lwtCountdown-1.0.js"></script>
	<script language="Javascript" type="text/javascript" src="js/misc.js"></script>
<link href="css/main.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div id="wrapper">

    
<div class="contentPane">

  <div class="leftPane">

    <div id="Listings">
        <?php
        if(!empty($active_offers)) {
            
            $i =1;
            foreach ($active_offers as $active_offer) {
              
              
               
               

?>
      <div class="item">
        <div class="content">
          
        <div class="footer">
         
           <div id="countdown_dashboard<?=$i?>">
			

			<div class="dash days_dash">
				<span class="dash_title">days</span>
				<div class="digit"><?=$date['days'][0]?></div>
				<div class="digit"><?=$date['days'][1]?></div>
			</div>

			<div class="dash hours_dash">
				<span class="dash_title">hours</span>
				<div class="digit"><?=$date['hours'][0]?></div>
				<div class="digit"><?=$date['hours'][1]?></div>
			</div>

			<div class="dash minutes_dash">
				<span class="dash_title">minutes</span>
				<div class="digit"><?=$date['mins'][0]?></div>
				<div class="digit"><?=$date['mins'][1]?></div>
			</div>

			<div class="dash seconds_dash">
				<span class="dash_title">seconds</span>
				<div class="digit"><?=$date['secs'][0]?></div>
				<div class="digit"><?=$date['secs'][1]?></div>
			</div>

		</div></div>
         
        </div>
      </div>
      <?php
      $i++;
            }

        }
        ?>

     
    </div>

</div>
</div>

</div>

    <script language="javascript" type="text/javascript">
			jQuery(document).ready(function() {
            $('#countdown_dashboard1').countDown({
	        targetOffset: {
	            'day':      1,
	            'month':    1,
	            'year':     0,
	            'hour':     1,
	            'min':      1,
	            'sec':      5
	        }
	    });

	    // Set the second Countdown
	    $('#countdown_dashboard2').countDown({
	        targetOffset: {
	            'day':      10,
	            'month':    1,
	            'year':     0,
	            'hour':     6,
	            'min':      34,
	            'sec':      10
	        }
	    });
                              

				

			});
		</script>
</body>
</html>
